/*
 * Background Flickr: Copyright (C) 2009  Craig McNicholas
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ddw.app.bflickr.flickr.api;

import com.ddw.app.bflickr.flickr.api.request.FlickrApiOnRequestCompletedEventArgs;


/**
 * Interface for request listeners to receive asynchronous callbacks 
 * from data request methods.
 * @author craig
 *
 */
public interface FlickrRequestListener {

	/**
	 * This function is raised if and when the request completes. This does not 
	 * mean that the request was entirely successful but that it contains some 
	 * form of data. Use the hasResponse() method to see if the object has relevant 
	 * information.
	 * @param args the request complete event args
	 */
	public void onRequestCompleted(FlickrApiOnRequestCompletedEventArgs args);
	
	/**
	 * This function is raised if the request fails in some form. The exception 
	 * passed is the original generated from the exception. 
	 * @param throwable the exception that occurred
	 */
	public void onRequestError(Throwable throwable);
	
	/**
	 * This function is raised if there is a problem whilst parsing the returned 
	 * content from the request. The exception passed is the original generated 
	 * from the parsing error.
	 * @param throwable
	 */
	public void onParseError(Throwable throwable);
	
}
